package com.bc.bcapi.service;

import com.bc.commoncore.util.CookieUtils;
import com.bc.commoncore.util.StringUtils;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @Name LanuageService
 * @Description TODO
 * @Author douhaichao
 * @Date 2018/10/27 20:13
 * @Version 1.0
 **/
@Service
public class LanguageService {

    public String getCurrentLanguage(HttpServletRequest request, HttpServletResponse response,
                                      String platform_cookie_name) {
        String cookie = CookieUtils.getCookie(request, response, platform_cookie_name);
        String lan = "zh";
        if (!StringUtils.isEmpty(cookie)) {
            lan = cookie;
        }
        return lan;
    }
}
